﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using JoyTalq.Core.Business;
using JoyTalq.Core.Business.Service;
using JoyTalq.Core.Business.Domain;
using JoyTalq.Core.Bus;
using JoyTalq.Core.Bus.Service;
using JoyTalq.Core.Bus.Domain;

namespace JoyTalq.Core.Business.Test.Service
{
    [TestFixture]
    public class TestBusService
    {
        public BusFactory BusFactory { get; set; }
        public IBusService BusService { get; set; }

        [TestFixtureSetUp]
        public void TestCaseInit()
        {
            BusFactory = new BusFactory();
            BusService = BusFactory.GetBusService();
        }

        [Test]
        public void Test_GetStopById()
        {
            StopVO stopVO = BusService.GetStopById("20159");
            Assert.IsNotNull(stopVO);
            Console.WriteLine("Id = " + stopVO.Id);
            Console.WriteLine("NameZh = " + stopVO.NameZh);
            Console.WriteLine("NameEn = " + stopVO.NameEn);
        }

        [Test]
        public void Test_GetAllStopList()
        {
            Console.WriteLine("start = " + DateTime.Now);
            IList<StopVO> stopList = BusService.GetAllStopList(0, 10, "Id", true);
            Console.WriteLine("end = " + DateTime.Now);
            Console.WriteLine("count = " + stopList.Count());

            Console.WriteLine("start = " + DateTime.Now);
            IList<StopVO> stopList2 = BusService.GetAllStopList();
            Console.WriteLine("end = " + DateTime.Now);
            Console.WriteLine("count = " + stopList2.Count());
        }
    }
}
